﻿@{
    ViewBag.Title = "菜肴列表";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(       
 Html.DWZGridFor<Resto.CostControl.Core.Dish>()
    .Title("菜肴列表")
    .Action(@Url.Action("Index"))
    .Columns(col =>
    {
        col.Bind(e => e.Id).IsKey();
        col.Bind(e => e.Code).Width(60).AsQuery();
        col.Bind(e => e.Name).Width(100).AsQuery().Align(FlexiGridAlign.Left);
        col.Bind(e => e.Category).Width(40).EnumKey("DishType");
        col.Bind(e => e.MainMaterialType).Width(50).EnumKey("MaterialCategory");
        col.Bind(e => e.Cost).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.Price).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.CookType).Width(50).EnumKey("CookType");
        col.Bind(e => e.UpdateUser).Width(60);
        col.Bind(e => e.UpdateDate).Width(70).DateFormat("yyyy-MM-dd");
        col.Bind(e => e.Id, "操作", 120).Sortable(false)
            .Template(Url.EditLinkTwo(Url.Action("Edit"), "编辑菜肴")
            + Url.DeleteLink("Delete", "${Name}"));
    })
    .Buttons(btn =>
    {
        btn.Bind("Add", "新建菜肴", FlexiGridButtonType.Add).Action(@Url.Action("Edit")).OnPress("AddNewTwo");
    })
)